package io;

import java.io.*;

public class OOSDemo {
    public static void main(String[] args) throws IOException {
        String name="张三";
        int age=25;
        String gender="男";
        String[] otherInfo={"是九亿少女的梦","喜欢美女","辽宁沈阳的","喜欢喝酒"};
        Student zs=new Student(name,age,gender,otherInfo);
        System.out.println(zs);
        FileOutputStream fos=new FileOutputStream("student.obj");
        ObjectOutputStream oos=new ObjectOutputStream(fos);
        oos.writeObject(zs);
        System.out.println("写出完毕");
        oos.close();
        /*
        String name="张三";
        int age=25;
        String gender="男";
        String[] otherInfo={"是九亿少女的梦","喜欢美女","辽宁沈阳的","喜欢喝酒"} ;
        Student zs=new Student(name,age,gender,otherInfo);
        System.out.println(zs);
        FileOutputStream fos=new FileOutputStream("student.obj");
        ObjectOutputStream oos=new ObjectOutputStream(fos);
        oos.writeObject(zs);
        System.out.println("写出完毕");
        oos.close();

         */
    }
}
